package com.fh.service.information.schooltime;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.fh.dao.DaoSupport;
import com.fh.entity.Page;
import com.fh.util.PageData;

@Service("schoolTimeService")
public class SchoolTimeService {

	@Resource(name = "daoSupport")
	private DaoSupport dao;

	// private final static String Mapper = "NoticeMapper";

	/*
	 * 列表
	 */
	public List<PageData> list(Page page) throws Exception {
		return (List<PageData>) dao.findForList("SchoolTimeMapper.listPage", page);
	}

	/*
	 * 通过id获取数据
	 */
	public PageData findById(PageData pd) throws Exception {
		return (PageData) dao.findForObject("SchoolTimeMapper.findById", pd);
	}

	/*
	 * 保存
	 */
	public void save(PageData pd) throws Exception {
		dao.save("SchoolTimeMapper.insert", pd);
	}

	public List<PageData> listAll(PageData pd) throws Exception {
		return (List<PageData>) dao.findForList("SchoolTimeMapper.TimelistAll", pd);
	}

	/*
	 * 修改
	 */
	public void edit(PageData pd) throws Exception {
		dao.update("SchoolTimeMapper.update", pd);
	}

	/*
	 * 删除
	 */
	public void delete(PageData pd) throws Exception {
		dao.update("SchoolTimeMapper.delete", pd);
	}

	// 启用状态
	public void statuse(PageData pd) throws Exception {
		dao.update("SchoolTimeMapper.statuse", pd);
	}
}
